home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / encrypt / md5test.asp < prev    next >
Text File  |  1998-05-21  |  1KB  |  45 lines

  1. <html>
  2. <body>
  3.  
  4. <%
  5. If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
  6.     Set md5 = Server.CreateObject("YEncrypt.MD5")
  7.     EncryptedPassword = md5.Encrypt(Request.Form("password"))
  8.     Set md5 = Nothing
  9. %>
  10.  
  11. The encrypted form of the password you entered is:<p>
  12.  
  13. <b><%=EncryptedPassword%></b><p>
  14.  
  15. Use it to compare against the passwords you store in your user database.
  16.  
  17. <%
  18. Else
  19. %>
  20.  
  21. <p>This sample ASP page shows the use of the MD5 encryption component. The password
  22. entered is encrypted by the MD5 component and the resulting hash can be further compared
  23. against the encrypted password database on the server. MD5 hashes are always 32 characters
  24. long.</p>
  25.  
  26. <table border="1" cellpadding="15">
  27.   <tr>
  28.     <td width="89%"><form method="POST">
  29.       <p>Enter your password: </p>
  30.       <p><input type="password" name="password" size="20"></p>
  31.       <p><input type="submit" value="Submit" name="Submit"></p>
  32.     </form>
  33.     </td>
  34.   </tr>
  35. </table>
  36. <%
  37. End If
  38. %>
  39.  
  40. <p> </p>
  41.  
  42. <p>Copyright 1998 Yuri Software <a href="http://www.yurisw.com">http://www.yurisw.com</a> </p>
  43. </body>
  44. </html>
  45.